package org.easy.tool.config;

import org.easy.tool.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author Valley
 * Created by Valley on 2023/8/29 16:36
 */
@RestControllerAdvice
public class ToolExceptionHandler {

    @ExceptionHandler(value = Exception.class)
    public R exceptionHandler(Exception e){
        e.printStackTrace();
        return R.fail(e.getMessage());
    }

}
